using UnityEngine;

public class CustomShareWithIntent
{
	private static AndroidJavaObject _plugin;

	public static bool isFacebookInstalled
	{
		get
		{
			if (Application.platform != RuntimePlatform.Android)
			{
				return false;
			}
			return _plugin.Call<bool>("hasFacebookInstalled", new object[0]);
		}
	}

	public static bool isTwitterInstalled
	{
		get
		{
			if (Application.platform != RuntimePlatform.Android)
			{
				return false;
			}
			return _plugin.Call<bool>("hasTwitterInstalled", new object[0]);
		}
	}

	static CustomShareWithIntent()
	{
		if (Application.platform != RuntimePlatform.Android)
		{
			return;
		}
		using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.pronetis.customsharewithintent.CustomShareWithIntent"))
		{
			_plugin = androidJavaClass.CallStatic<AndroidJavaObject>("instance", new object[0]);
		}
	}

	public static void ShareToFacebook(string text, string url, string imagePath)
	{
		if (Application.platform == RuntimePlatform.Android)
		{
			_plugin.Call("shareTextAndImageToFacebook", text, url, imagePath);
		}
	}

	public static void ShareToTwitter(string text, string url, string imagePath)
	{
		if (Application.platform == RuntimePlatform.Android)
		{
			_plugin.Call("shareTextAndImageToTwitter", text, url, imagePath);
		}
	}

	public static void ShareToOther(string text, string url, string imagePath)
	{
		if (Application.platform == RuntimePlatform.Android)
		{
			_plugin.Call("shareToOther", text, url, imagePath);
		}
	}
}
